package com.entity.serviceproblem;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 服务问题表实体类
 */
@ApiModel("服务问题表实体")
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("service_problem") // 映射到数据库表名
public class ServiceProblem {

    /**
     * 主键ID
     */
    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 关联任务单ID
     */
    @ApiModelProperty(value = "关联售后单ID")
    @TableField("after_sales_id")
    private Long afterSalesId;

    /**
     * 关联产品ID
     */
    @ApiModelProperty(value = "关联产品ID")
    @TableField("product_id")
    private Long productId;

    /**
     * 产品名称
     */
    @ApiModelProperty(value = "产品名称")
    @TableField("product_name")
    private String productName;

    /**
     * 安装日期
     */
    @ApiModelProperty(value = "安装日期")
    @TableField("installation_date")
    private String installationDate;

    /**
     * 问题处理时间
     */
    @ApiModelProperty(value = "问题处理时间")
    @TableField("resolution_date")
    private LocalDate resolutionDate;

    /**
     * 安装站名
     */
    @ApiModelProperty(value = "安装站名")
    @TableField("install_station")
    private String installStation;

    /**
     * 安装位置
     */
    @ApiModelProperty(value = "安装位置")
    @TableField("installation_location")
    private String installationLocation;

    /**
     * 口径
     */
    @ApiModelProperty(value = "口径")
    @TableField("bore_size")
    private String boreSize;

    /**
     * 材质
     */
    @ApiModelProperty(value = "材质")
    @TableField("material")
    private String material;

    /**
     * 型号
     */
    @ApiModelProperty(value = "型号")
    @TableField("model_number")
    private String modelNumber;

    /**
     * 出厂编号
     */
    @ApiModelProperty(value = "出厂编号")
    @TableField("production_number")
    private String productionNumber;

    /**
     * 故障现象
     */
    @ApiModelProperty(value = "故障现象")
    @TableField("fault_description")
    private String faultDescription;

    /**
     * 原因分析
     */
    @ApiModelProperty(value = "原因分析")
    @TableField("fault_analysis")
    private String faultAnalysis;

    /**
     * 排除方法
     */
    @ApiModelProperty(value = "排除方法")
    @TableField("resolution_method")
    private String resolutionMethod;

    /**
     * 处理结果
     */
    @ApiModelProperty(value = "处理结果")
    @TableField("resolution_result")
    private String resolutionResult;

    /**
     * 改进意见
     */
    @ApiModelProperty(value = "改进意见")
    @TableField("improvement_suggestions")
    private String improvementSuggestions;

    /**
     * 问题归类
     */
    @ApiModelProperty(value = "问题归类")
    @TableField("problem_category")
    private String problemCategory;

    /**
     * 现场照片路径
     */
    @ApiModelProperty(value = "现场照片路径")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> photos;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @TableField("remark")
    private String remark;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @TableField("created_by")
    private String createdBy;

    /**
     * 创建时间，默认为当前时间
     */
    @ApiModelProperty(value = "创建时间，默认为当前时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间，每次更新时自动刷新
     */
    @ApiModelProperty(value = "更新时间，每次更新时自动刷新")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 状态: editing, confirmed, published, completed, processing, archived
     */
    @ApiModelProperty(value = "状态: editing, confirmed, published, completed, processing, archived")
    @TableField("status")
    private String status;

    @ApiModelProperty(value = "逻辑删除字段：1 存在 0 删除")
    @TableField("is_deleted")
    private Integer isDeleted;

    @ApiModelProperty(value = "客户公司ID")
    @TableField("customer_company_id")
    private Long customerCompanyId;
}